package org.market.domain.strategy.model.entity;

import lombok.*;
import org.market.domain.strategy.model.valobj.RuleLogicCheckTypeVO;




/**
 * @Author: Insight
 * @Description: 抽奖过滤后行为实体
 * @Date: 2025/2/8 下午9:54
 * @Version: 1.0
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity>{

    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();
    private T data;
    private String ruleModel;


    /**
     * 空参父类用于继承,防止传进来别的不合法类
     * */
    static public class RaffleEntity {
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class BeforeRaffleActionEntity extends RaffleEntity {
        /**策略id*/
        private Long strategyId;
        /**奖品id*/
        private Integer awardId;
        /**抽奖权重策略key*/
        private String ruleWeightValueKey;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class DuringRaffleActionEntity extends RaffleEntity{
        /**策略id*/
        private Long strategyId;
        /**奖品id*/
        private Integer awardId;
    }
    public static class AfterRaffleActionEntity extends RaffleEntity{}

}
